﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Brio.Framework
{
    public class TechniqueCollection : Dictionary<string,Technique>
    {
        public TechniqueCollection()
        {
        }


        public static string[] SampleCollectionNames = new string[] { "Demo", "Joplin", "Pop" };

        public void LoadCollection(string collectionName)
        {
            switch (collectionName)
            {
                case "Demo":
                    AddDemo();
                    break;
                case "Joplin":
                    AddScottJoplin();
                    break;
                case "Pop":
                    AddRandomPop();
                    break;
            }
        }


        public void AddDemo()
        {
            Technique demo_tech_1 = new Technique("e e e e e e e e", "C4 C5 C4 C5 C4 C5 C4 C5",
                                        "T1", 10.00, "T2", 1.50, 0.00,
                                        RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                        NoteTechniqueFormat.ScientificNotation);
            Technique demo_tech_2 = new Technique("e e e e e e e e", "F3 F4 F3 F4 F3 F4 F3 F4",
                                        "T2", 10.00, "T3", 1.50, 0.50,
                                        RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                        NoteTechniqueFormat.ScientificNotation);
            Technique demo_tech_3 = new Technique("e e e e e e e e", "G3 G4 G3 G4 G3 G4 G3 G4",
                                        "T3", 10.00, string.Empty, -1, 0.50,
                                        RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                        NoteTechniqueFormat.ScientificNotation);


            this.Add(demo_tech_1.Name, demo_tech_1);
            this.Add(demo_tech_2.Name, demo_tech_2);
            this.Add(demo_tech_3.Name, demo_tech_3);
        }



        public void AddRandomPop()
        {
            Technique pop_tech_1 = new Technique("e e e e e sh", "C4 E4 G4 C5 A4 F4",
                                             "T1", 120.0, "T2", 2, 0.20,
                                             RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                             NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_2 = new Technique("e e e e e sh", "C5 B4 C5 G4 D4",
                                                "T2", 130.0, string.Empty, -1,  0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_3 = new Technique("s s e e e e sh", "C5 E5 C5 A4 F4 A4 C4",
                                                "T3", 5.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_4 = new Technique("s s e e e h", "C4 E4 G4 E4 G4 C5",
                                                "T4", 20.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            
            Technique pop_tech_5 = new Technique("e e e e e e", "C4 C4 E4 E4 G4 G4",
                                                "T5", 40.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_6 = new Technique("e e e e e e", "F4 F4 A4 A4 C5 C5",
                                                "T6", 40.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_7 = new Technique("e e e e e e", "G4 G4 B4 B4 D5 D5",
                                                "T7", 40.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);





            Technique pop_tech_8 = new Technique("e e e e", "C4 C5 E5 C5",
                                                "T8", 80.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique pop_tech_9 = new Technique("e e e e", "C4 C5 E5 C5",
                                                "T9", 20.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);


            Technique pop_tech_10 = new Technique("e e e e", "G4 D5 C4 D5",
                                                "T10", 60.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);


            Technique pop_tech_11 = new Technique("e e e e", "C5 F4 A4 F4",
                                                "T11", 15.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);




            this.Add(pop_tech_1.Name, pop_tech_1);
            this.Add(pop_tech_2.Name, pop_tech_2);
            this.Add(pop_tech_3.Name, pop_tech_3);
            this.Add(pop_tech_4.Name, pop_tech_4);
            this.Add(pop_tech_5.Name, pop_tech_5);
            this.Add(pop_tech_6.Name, pop_tech_6);
            this.Add(pop_tech_7.Name, pop_tech_7);
            this.Add(pop_tech_8.Name, pop_tech_8);
            this.Add(pop_tech_9.Name, pop_tech_9);
            this.Add(pop_tech_10.Name, pop_tech_10);
            this.Add(pop_tech_11.Name, pop_tech_11);
        }


        public void AddScottJoplin()
        {
            Technique sj_tech_1 = new Technique("e q e", "E3 C4 E3",
                                                "T1", 10.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique sj_tech_2 = new Technique("q q", "C4 E3",
                                                "T2", 5.0, "T1", 1.50, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            Technique sj_tech_3 = new Technique("h", "C4",
                                                "T3", 5.0, "T2", 1.50, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);
            
            Technique sj_tech_4 = new Technique("e e e e", "E4 C4 D4 E4",
                                                "T4", 15.0, string.Empty, -1, 0.20,
                                                RhythmTechniqueType.RhythmRelationship, NoteTechniqueType.NoteRelationship,
                                                NoteTechniqueFormat.ScientificNotation);

            this.Add(sj_tech_1.Name, sj_tech_1);
            this.Add(sj_tech_2.Name, sj_tech_2);
            this.Add(sj_tech_3.Name, sj_tech_3);
            this.Add(sj_tech_4.Name, sj_tech_4);

        }


        public void AddBetaBlues()
        {
            // TODO 4/17/2011
        }




    }
}
